package com.hmall.common.aop;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * @author ChenPi
 * @since 2025/03/24 17:03
 * todo 暂时没想明白怎么用注解操作mq，写切面的时间比直接使用封装的工具类耗时更多
 */
@Slf4j
@Aspect
@Component
@RequiredArgsConstructor
@Deprecated
public class MQAspect {

    private final RabbitTemplate rabbitTemplate;

    @AfterReturning("@annotation(com.hmall.common.annotation.SendMessageToMQ)")
    public void sendToMQ(JoinPoint joinPoint) {
        log.info("发送MQ消息：{}");
    }

}
